package com.evo.chat.web.domain;

import com.evo.chat.common.base.BaseEntity;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;

/**
 * @author luwenzheng
 * date 2020-02-06
 */
@Entity
@Table(name = "user_password")
public class UserPassword extends BaseEntity {

    /**
     * 加密密码
     */
    @NotEmpty(message = "密码不能为空")
    private String encryptPassword;

    /**
     * 对应用户ID
     */
    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "user_info_id")
    private UserInfo user;

    public String getEncryptPassword() {
        return encryptPassword;
    }

    public void setEncryptPassword(String encryptPassword) {
        this.encryptPassword = encryptPassword;
    }

    public UserInfo getUser() {
        return user;
    }

    public void setUser(UserInfo user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "UserPassword{" +
                "encryptPassword='" + encryptPassword + '\'' +
                ", user=" + user +
                '}';
    }
}
